import Vue from 'vue'
import VueRouter from 'vue-router'
//懒加载webpack-chunk代码块组件，注意引用的目录，router和views平级，需要..，单router在public下，可以使用.
const Login = () => import(/* webpackChunkName:'login' */ '../views/Login.vue')
const Register = () => import(/* webpackChunkName:'register' */ '../views/Register.vue')
const Forget = () => import(/* webpackChunkName:'forget' */ '../views/Forget.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/forget',
    name: 'forget',
    component: Forget
  }
]

const router = new VueRouter({
  routes
})

export default router
